<?php

namespace App\Http\Controllers\Third\Xiaoke;

use App\Http\Controllers\BaseController;
use App\Http\Controllers\Controller;
use App\Http\Validate\Third\Xiaoke\XiaokeValidate;
use App\Service\Third\Xiaoke\XiaokeService;
use Illuminate\Http\JsonResponse;
use Illuminate\Http\Request;
use Illuminate\Support\Facades\Log;
use Illuminate\Validation\ValidationException;
use Psr\Container\ContainerExceptionInterface;
use Psr\Container\NotFoundExceptionInterface;

class XiaokeController extends BaseController
{

    /**
     * 销氪回调
     *
     * @param Request $request
     * @return JsonResponse
     * @throws ValidationException
     * @throws ContainerExceptionInterface
     * @throws NotFoundExceptionInterface
     */
    public function notify(Request $request): JsonResponse
    {
        Log::info("xiaoke-notify", $request->all());
        XiaokeService::notify(XiaokeValidate::notifyValidate($request->all()));
        return $this->success();
    }


}
